﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GedeaProject.Business.Parsers.Helpers
{
    internal class TextDebitParserFormatter
    {
        internal static string IntFormat(int value, int length)
        {
            return StringFormat(value.ToString(), length, '0', true);
        }

        internal static string StringFormat(string value, int length, char app, bool appGoesBefore)
        {
            if (value.Length < length)
            {
                string append = "";
                for (int i = 0; i < length - value.Length; i++)
                {
                    append += app;
                }
                value = appGoesBefore ? append + value : value + append;
            }
            //return value.Remove(length);
            return value;
        }
    }
}
